<?php 

    include("header.php");

?>



<head>

    <title>Liga - Invoer nieuwsbericht</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <link href="assets/css/default.css" rel="stylesheet" type="text/css">



    <style type="text/css">

        @import "/assets/js/dojo-release-1.1.0/dijit/themes/tundra/tundra.css";

    </style>

    

    <script type="text/javascript" src="/assets/js/dojo-release-1.1.0/dojo/dojo.js"

      djConfig="parseOnLoad: true"></script>

    

    <script type="text/javascript">

        dojo.require("dijit.form.Button");

        dojo.require("dijit.InlineEditBox");

        dojo.require("dijit.Editor");

        dojo.require("dijit._editor.plugins.AlwaysShowToolbar");

        dojo.require("dijit._editor.plugins.EnterKeyHandling");

        dojo.require("dijit._editor.plugins.TextColor");

        dojo.require("dijit._editor.plugins.LinkDialog");

        dojo.require("dijit._editor.plugins.EditorImageDialog");

        dojo.require("dojo.parser");

    </script>

    

    <script>

       function successCommand(data,ioArgs) {

           if (data != '') {

               dojo.byId('newsAlert').className='error';

               dojo.byId('newsAlert').innerHTML=data;

           } else {

               window.location = "/newsbox.php";

           }

       }       

       

       function errorCommand(data, ioArgs) {

           dojo.byId('newsAlert').className='error';

           dojo.byId('newsAlert').innerHTML='Uw bericht is niet opgeslagen. Gelieve contact op te nemen met de webmaster.';

       }

    </script>



</head>



<?php

    setTabIndex(1);

    createBody("default");

    

    if ( isset($_SESSION['user']) == false ) {

        redirect("/newsbox.php");

    }

    

    $user = $_SESSION['user'];

?>

<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="#FFFFFF">

    <tr>

        <td id="leftFiller" valign="top" height="100%" rowspan="3" bgcolor="#006633">

            <table border="0" cellpadding="0" cellspacing="0" height="100%" width="8px">

                <tr><td>&nbsp;</td></tr>

            </table>

        </td>

        <td id="header" valign="top" width="100%">

            <table border="0" width="100%" cellpadding="3" cellspacing="0" bgcolor="#10425b">

                <tr>

                    <td bgcolor="#006633" width="40%">

                        <?php include("inc_title.html"); ?>

                    </td>

                    <td bgcolor="#006633" align="right">

                        <a href="insert_news_form.php"><img src="assets/images/16x16/add.gif" border="0" alt="Voeg nieuwsbericht toe"></a>

                        &nbsp;&nbsp;

                    </td>

                </tr>

            </table>

            <table align="center" border="0" width="100%" height="90%" cellpadding="0" cellspacing="0" style="border-top:#BCDD10 4px solid;">

                <tr> 

                    <?php include("inc_sublinks.php"); ?>   

                </tr>

                <tr><td colspan="3" nowrap bgcolor="#BCDD10" height="4"><img src="/assets/images/spacer.gif" alt="" height="1" width="1"></td></tr>

                <tr>

                    <td>&nbsp;</td>

                    <td width="90%" valign="top">

                        <br>

                        <span class="blackHeaderLarge">Nieuwsbericht</span>

                        &nbsp;&nbsp;

                        <span class="hidden" id="newsAlert"></span>

                        <form id="newsForm" method="post">

                            <div style="border: 1px solid #ccc" class="tundra">

                                <h4 id="titleInlineBox" name="newsTitle" dojoType="dijit.InlineEditBox" 

                                    title="Voer hier uw titel in" autoSave="true">Typ hier uw titel</h4>

                                <h4 id="introImageBox" name="introImageBox" dojoType="dijit.InlineEditBox" 

                                    title="Kies een afbeelding voor uw intro (optioneel)" autoSave="true">http://</h4>

                                <!--

                                * Character Formatting: bold, italic, underline, strikethrough, subscript, superscript, removeFormat, forecolor, hilitecolor

                                * Paragraph Formatting:: indent, outdent,justifyCenter, justifyFull, justifyLeft, justifyRight, delete, selectall

                                * Inserting Objects:insertOrderedList, insertUnorderedList, createlink (use LinkDialog plugin), inserthtml

                                * Misc.: undo, redo, cut, copy, paste

                                -->

                                <textarea id="introEditor" dojoType="dijit.Editor" height="100"

                                    plugins="['undo', 'redo', 'cut', 'copy', 'paste',

                                    '|', 'bold','italic','underline',

                                    '|','createLink','foreColor','hiliteColor']"

                                    styleSheets="/assets/js/dojo-release-1.1.0/dojo/resources/dojo.css">

                                    Uw intro

                                </textarea>

                                <textarea id="editor" dojoType="dijit.Editor" height="250"

                                    plugins="['undo', 'redo', 'cut', 'copy', 'paste',

                                    '|', 'bold','italic','underline','strikethrough','subscript', 'superscript', 'removeFormat',

                                    '|','indent', 'outdent','justifyCenter', 'justifyFull', 'justifyLeft', 'justifyRight', 'delete', 'selectall',

                                    '|','createLink','insertImage','foreColor','hiliteColor','insertOrderedList','insertUnorderedList', 'toggleDir']"

                                    styleSheets="/assets/js/dojo-release-1.1.0/dojo/resources/dojo.css">

                                    Uw nieuwsbericht

                                </textarea> 

                            </div>

                            <input type="hidden" id="newsTitle" name="newsTitle" />

                            <input type="hidden" id="newsIntroImage" name="newsIntroImage" />

                            <input type="hidden" id="newsIntro" name="newsIntro" />

                            <input type="hidden" id="newsContent" name="newsContent" />

                        </form>

                        <button dojoType="dijit.form.Button" id="submitButton" class="tundra">

                            Doorsturen

                            <script type="dojo/method" event="onClick">

                                dojo.byId('newsTitle').value = dijit.byId('titleInlineBox').getValue();

                                dojo.byId('newsIntroImage').value = dijit.byId('introImageBox').getValue();

                                dojo.byId('newsIntro').value = dijit.byId('introEditor').getValue();

                                dojo.byId('newsContent').value = dijit.byId('editor').getValue();

                                dojo.xhrPost({

                                    url: '/insert_news.php',

                                    load: successCommand,

                                    error: errorCommand,

                                    form: 'newsForm'

                                });

                            </script>

                        </button>

                    </td>

                    <td width="5%">&nbsp;</td>

                </tr>

            </table>

        </td>

    </tr>

</table>



</body>

</html>

